﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SHDM
{
    public class Conf
    {
        public static int RedisDatabase
        {
            get
            {
                if (ConfigurationManager.AppSettings.AllKeys.Contains("RedisDatabase"))
                {
                    return int.Parse(ConfigurationManager.AppSettings["RedisDatabase"]);
                }
                return 0;
            }
        }

        public static string RedisConnectString
        {
            get
            {
                if (ConfigurationManager.AppSettings.AllKeys.Contains("RedisConnectString"))
                {
                    return ConfigurationManager.AppSettings["RedisConnectString"];
                }
                return string.Empty;
            }
        }

        public static string CacheType
        {
            get
            {
                if (ConfigurationManager.AppSettings.AllKeys.Contains("CacheType"))
                {
                    return ConfigurationManager.AppSettings["CacheType"];
                }
                return "Memory";
            }
        }
    }
}
